package cn.whx.hrm;

import cn.whx.hrm.doc.CourseDoc;
import cn.whx.hrm.query.CourseDocQuery;
import cn.whx.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseDocFallBackFactory implements FallbackFactory<CourseClient>{

    @Override
    public CourseClient create(Throwable cause) {
        return new CourseClient() {
            @Override
            public AjaxResult add(CourseDoc courseDoc) {
                return AjaxResult.me().setSuccess(false).setMessage("上线失败");
            }

            @Override
            public AjaxResult delete(Long id) {
                return AjaxResult.me().setSuccess(false).setMessage("下线失败");
            }

            @Override
            public AjaxResult query(CourseDocQuery query) {
                return AjaxResult.me().setSuccess(false).setMessage("搜索失败");
            }

        };
    }
}
